import Vue from 'vue'

import {
  createdAuth
} from '@/utils/createdAuth'
import {
  getSessionStorage
} from '@/utils/base'

/*权限*/
Vue.directive('auth', function(el, binding) {

  let auth = getSessionStorage("authlist");


  if (!auth) {
    let authlist = {}
    createdAuth(auth, authlist);
    setSessionStorage("auth",authlist);
    auth = authlist;
  }
  let value = binding.value.toLowerCase();
  if (auth[value] != true) {
	  // console
    el.style.display = "none";
  }

})

